package main

import(
	"fmt"
)

func main(){
	fmt.Println(twoSum([]int{2,11,7,5}, 9))
}

func twoSum(nums []int, target int) []int {
	numMap := make(map[int]int);
	for index, num := range nums {
		if i, ok := numMap[target - num]; ok {
			return []int{i, index}
		}
		numMap[num] = index
	}
    return []int{}
}